package com.linkai.JUC._10_function;

import java.util.function.Supplier;

/**
 * @Description: Supplier 供给型接口：没有参数，只有返回值
 * @Author: 林凯
 * @Date: 2021/10/25 14:18
 */
public class Test04_Supplier {
    public static void main(String[] args) {
        Supplier<Integer> supplier = new Supplier<Integer>() {
            @Override
            public Integer get() {
                return 1024;
            }
        };

        Supplier<Integer> supplier2 =()->{
          return 1024;
        };


        System.out.println(supplier.get());
        System.out.println(supplier2.get());
    }
}
